<template>
	<div class="wrap">	
		<e-chart :options="optionCharts" style="height:100%;"></e-chart>		
	</div>
</template>	
<script>
	import {getDeptAndSiteNum} from "@/api/bigScreen/bigScreen";
	export default {
		data() {
			return {				
				optionCharts :{
				    title: {
				        text: '近一年接入企业与点位累计数',
				        show:false
				    },
				    tooltip: {
				        trigger: 'axis'
				    },
				    legend: {
				    	show:true,
				    	top:10,
				    	textStyle:{
				    		color:'#fff'
				    	},
				        data: ['点位数', '企业数']
				    },
				    grid: {
				        left: 20,
				        right: 20,
				        top:35,
				        bottom:30,
				        containLabel: true
				    },
				    xAxis: {
				        type: 'category',
				        boundaryGap: false,
				        data: [],
                        axisLabel: {
                            // interval: 0, //坐标刻度之间的显示间隔，默认就可以了（默认是不重叠）
                            color: '#fff'
                        },				        
				    },
				    yAxis: {
				        type: 'value',
				        axisLabel:{
				        	color: '#fff'
				        }
				    },
				    series: [
				        {
				            name: '企业数',
				            type: 'line',
				            stack: '总量',
							itemStyle : {
							   normal : {
							     lineStyle:{
							       color:'#5b9bd5' 
							     }
							    }
							},				            
				            data: []
				        },
				        {
				            name: '点位数',
				            type: 'line',
				            stack: '总量',
							itemStyle : {
							   normal : {
							     lineStyle:{
							       color:'#eb7220' 
							     }
							    }
							},				            
				            data: []
				        }
				    ]
				}				
			}
		},
		mounted() {
		},
		methods: {
           init(arr){
	          for(var i=0;i<arr.length;i++){
	          		this.optionCharts.xAxis.data.push(arr[i].date)
	          		this.optionCharts.series[0].data.push(arr[i].deptNum)
	          		this.optionCharts.series[1].data.push(arr[i].siteNum)
	          }           	
           }
		}
	}
</script>
<style lang="scss" scoped>
	.wrap{height: 100%;}
</style>
